import Vue from 'vue'
import Vuex from 'vuex'

import mutations from './mutation'
import actions from './actions'
import getters from './getters'
import moduleA from './modules/moduleA'

Vue.use(Vuex)


const state = {
  counter: 1000, //如果直接修改的话，默认是 mutations，但是不会 vue-devtools 被监听到
  students: [
    {id: 110, name: 'why', age: 18},
    {id: 111, name: 'koby', age: 24},
    {id: 112, name: 'james', age: 30},
    {id: 113, name: 'curry', age: 10},
  ],
  info: {
    bookName: 'Swift',
    bookPrice: 12.5
  }
}


const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters,
  modules: {
    aa: moduleA
  }
})

export default store